import React, { Component } from 'react'
import propTypes from 'prop-types'
export default class Dialog extends Component {
  static propTypes = {
    money: propTypes.number.isRequired,
    car: propTypes.shape({
      brand: propTypes.string.isRequired,
      price: propTypes.number.isRequired
    })
  }
  static defaultProps = {
    money: 0
  }

  render() {
    return (
      <div>
        <h1>Dialog</h1>
        <p>children---:{this.props.children}</p>
        <div>再来一个---{this.props.title('123')}</div>
        <p>money:{this.props.money}</p>
        <div>{this.props.car.price}</div>
      </div>
    )
  }
}
// Dialog.propTypes = {
//   money: propTypes.number.isRequired,
//   car: propTypes.shape({
//     brand: propTypes.string.isRequired,
//     price: propTypes.number.isRequired
//   })
// }